/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package server.so.vezbac;

import domen.OpstiDomenskiObjekat;
import domen.Vezbac;
import server.baza.DataBaseBroker;
import server.so.OpstaSO;

/**
 *
 * @author Ivan Ivic
 */
public class ObrisiVezbaca extends OpstaSO {
    
    public synchronized static int obrisiVezbaca(Vezbac vezbac)
    {
        ObrisiVezbaca ov = new ObrisiVezbaca();
        return ov.opsteIzvrsenjeSO(vezbac);
    }

    @Override
    public int izvrsenjeSO(OpstiDomenskiObjekat odo) {
        Vezbac v = (Vezbac) odo;
        signal = DataBaseBroker.getDbb().obrisi(v); // 9015, 9016
        return signal;
    }

    @Override
    public boolean stanjeOperacije(int signal) {
        switch(signal)
        {
            case 9015:
                prikazi(signal, "Slog uspesno obrisan");
                return true;
            case 9016:
                prikazi(signal, "Slog nije obrisan");
                return false;
            default:
                return true;
        }
    }   
}
